package com.wangx1n;


import com.wangx1n.bean.Person;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.AbstractApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * @author WangXin
 * @date 2020/12/3 14:04
 */
public class MyTest {
    //    bean生命周期
    @Test
    public void BeanLifeCycleTest() {
        ApplicationContext context = new ClassPathXmlApplicationContext("bean.xml");
        Person person = context.getBean("person", Person.class);
        //注入了school
        System.out.println(person.getSchool().getName());
    }
}
